<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3-数组方法some</title>
</head>
<body>
    <script type="text/javascript">
        /**
         * arr.some(function(val,index,arr){});
         * 返回一个布尔值 true/false
         * 在数组中查找某个元素是否存在
         */
        var arr = [1,3,5,7,9];

        var flag = arr.some(function(val,index,arr){
            return val == 5;
        });
        console.log("是否存在::"+flag);

    </script>
</body>
</html>